import { getUserInfoUrl } from "@/command/apiTool";
import { useDetail, useList } from "@/hooks";
export const useRequest = () => {
  const userData: any = localStorage.getItem("userInfo");
  const userId = JSON.parse(userData).id;
  console.log(userId);
  const position = localStorage.getItem("positionData") as string;
  const positionJSON = JSON.parse(position) as {
    latitude: string;
    longitude: string;
  };
  //大户详情
  const [teamInfo] = useDetail(
    getUserInfoUrl(
      {
        dh: "",
        xh: "/api/H5/richMeansOfAgriculturalProduction/small/queryDhDetail",
      },
      {
        lat: positionJSON.latitude,
        lng: positionJSON.longitude,
      }
    ),
    {
      address: "",
      entityComment: " ",
      entityLogo: "",
      entityName: "",
      jl: "",
      id: "",
      phone: "",
    }
  );
  const [listByLarge] = useDetail(
    getUserInfoUrl({
      dh: "",
      xh: "/api/H5/richMeansOfAgriculturalProduction/small/listByLargeId",
    }),
    []
  );

  return {
    teamInfo,
    listByLarge,
  };
};
